﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using LEET.CommonInterfaces.Compilers;
using LEET.LEETCommon.Model;
using LEET.CommonInterfaces.TestControls;

namespace LEET.StandardModules.Instructions
{
    public class Options : Instruction
    {
        private String option;
        private String value;

        public Options(string[] args)
            : base(args)
        {
            option = "delay";
            value = args[2].Trim();
        }

        public static IAutomationActionResult StaticCall()
        {
            //TODO
            return null;
        }

        public override String RenderStaticCall()
        {
            //TODO
            return "LEET.StandardModules.Instructions.Options.StaticCall()";
        }

        [Obsolete("This should now be replaced by RenderStaticCall", false)]
        protected override String RenderedMethodName(int i)
        {
            return "_" + i + "_OPTIONS" + "()";
        }
        
        [Obsolete("This should now be replaced by RenderStaticCall", false)]
        protected override String MethodBody(AssertionSet asserts)
        {
            return "                " + option + " = " + value + ";\r\n                return new AutomationActionResult();\r\n";
        }

        public static Options apply(String[] args)
        {
            return new Options(args);
        }

        public override string PlainText()
        {
            return "Set pause between events to " + value + " milliseconds.";
        }
    }
}
